using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QuanLyKhachHang.BUS
{
	#region using
	using System.Data;
	using QuanLyKhachHang.DAO;
	using QuanLyKhachHang.DTO;
	#endregion
	public class CS_UUDAIBUS
	{
		private CS_UUDAIDAO objDAO;
		public CS_UUDAIBUS(String strPath)
		{
			objDAO = new CS_UUDAIDAO(strPath);
		}

		public DataSet SelectAll()
		{
			DataSet ds;
			try
			{
				ds = objDAO.SelectAll();
				return ds;
			}
			catch(System.Exception e)
			{
				throw new Exception(e.Message, e.InnerException);
			}
		}

		public DataSet SelectByID(string loai)
		{
			DataSet ds;
			try
			{
				ds = objDAO.SelectByID(loai);
				return ds;
			}
			catch(System.Exception e)
			{
				throw new Exception(e.Message, e.InnerException);
			}
		}

		public bool Insert(CS_UUDAIDTO obj)
		{
			try
			{
				return objDAO.Insert(obj);
			}
			catch
			{
				return false;
			}
		}

		public bool Delete(string loai)
		{
			try
			{
				return objDAO.Delete(loai);
			}
			catch
			{
				return false;
			}
		}

		public bool Update(CS_UUDAIDTO obj)
		{
			try
			{
				return objDAO.Update(obj);
			}
			catch
			{
				return false;
			}
		}

	}
}